<template>
	<view>
		<goods-list :hotgoods="hotgoods"></goods-list>
	</view>
</template>

<script>
	/* 把全局组件传过来 */
	import goodsList from '../../components/goods-list/goods-list.vue'
	export default {
		data() {
			return {
				hotgoods:[]
			}
		},
		onLoad() {
			this.getGoodsList()
		},
		components:{"goods-list":goodsList},
		methods: {
		//获取商品列表数据 
		async getGoodsList(){
			const res =await this.$myRuquest({
					url:'/hotgoods'
				})
				this.hotgoods = res.data
			}
			
		}
	}
</script>

<style>
.goods_list{
	background-color: #eee;
}
</style>
